<%@include file="/WEB-INF/common/taglibs.jsp"%>
<style>
.select2-choice{
	min-width: 200px;
}

</style>

<script>
	$(document).ready(function() {
		var opts = $("#LS-source").html();
		
  		$("#unit-select").html(opts);
  		$("#unit-select").val('${entity.unitNumber}');
		$("#unit-select").select2({
			minimumInputLength: 2,
	        formatInputTooShort: function (input, min) { return "Please enter block number"}
		});
		
		
	});
</script>
<c:set var="allTemplate" value="${requestScope.templates}" />

<div class="row-fluid">
	<div class="span8">
		<div class="row-fluid">
			<div class="box gradient">
				<form:form method="post" modelAttribute="user" id="form">
					<input type="hidden" name="_method" value="${_method }" />
					<div class="title">
						<h4 class="clearfix">
							<span class="left"> New </span> <a href="#" class="minimize">Minimize</a>
							<span class="box-form right">
								<button class="btn btn-success btn-mini" type="submit">Submit</button>
							</span>
						</h4>
					</div>
					<div class="content form-horizontal clearfix">
						<div class="form-row row-fluid">
							<label class="form-label span4">UserName</label> <input
								class="span8" type="text" value="${entity.userName}"
								name="userName" />
						</div>

						<div class="form-row">
							<label class="form-label span4">Password </label> <input
								class="span8" name="password" type="password"
								value="${entity.password}" />
						</div>


						<div class="form-row row-fluid">
							<label class="form-label span4">EmailAddress</label> <input
								class="span8" type="text" value="${entity.email}" name="email" />
						</div>
						<div class="form-row row-fluid">
							<label class="form-label span4">Login Name</label> <input
								class="span8" type="text" name="loginName"
								value="${entity.loginName}" />
						</div>

						<div class="form-row row-fluid">
 							 	<label class="form-label span4" for="email">Unit Number</label>
												<div class="span8 controls">
													<select id="unit-select" width="300px" type="text"
														name="unitNumber" class="nostyle"></select> 
						</div>
					</div>
					<div class="form-row row-fluid">
						<label class="form-label span4"> Status </label>

						<div class="span8 controls">
							<select name="status" id="status">
								<option value="ACTIVE"
									<c:if test="${entity.status eq 'ACTIVE'}">
 	                      		selected="selected"
  	                      		</c:if>>Active</option>
								<option value="Disable"
									<c:if test="${entity.status eq 'Disable'}">
 	                      		selected="selected"
  	                      		</c:if>>Disable</option>
  	                      		<option value="DisableBooking"
									<c:if test="${entity.status eq 'DisableBooking'}">
 	                      		selected="selected"
  	                      		</c:if>>Disable Booking</option>
							</select>
						</div>

					</div>
					
						<div class="form-row row-fluid">
						<label class="form-label span4"> Account Type </label>

						<div class="span8 controls">
							<select name="residentType" id="status">
								<option value="Tenant"
									<c:if test="${entity.residentType eq 'Tenant'}">
 	                      		selected="selected"
  	                      		</c:if>>Tenant </option>
								<option value="Owner"
									<c:if test="${entity.residentType eq 'Owner'}">
 	                      		selected="selected"
  	                      		</c:if>>Owner </option>
							</select>
						</div>

					</div>
					</div>
				</form:form>
			</div>


		</div>
	</div>
</div>
<div class="hidden">
	<select style="width: 200px" id="LS-source">
	<c:forEach var="group" items="${groups}">
		<option value="${group.code}">${group.code}</option>
	</c:forEach>
	</select>
</div>
